import 'package:flutter/material.dart';
import '../../../widget/PPButtonView.dart';

class PPMineHeadView extends StatefulWidget {
    PPMineHeadView({Key key, this.action}) : super(key: key);

    final Function action;

    _PPMineHeadViewState createState() => _PPMineHeadViewState();
}

class _PPMineHeadViewState extends State<PPMineHeadView> {

    @override
    Widget build(BuildContext context) {
        return Container(
            height: 200,
            color: Color.fromRGBO(70, 140, 155, 1),
            padding: EdgeInsets.fromLTRB(20, 45, 15, 15),
            child: Container(
            child: Row(
                children: <Widget>[
                    Container(
                        width: 65,
                        height: 65,
                        child: Image.asset("resource/images/user_rofile_icon.png"),
                    ),
                    PPButtonView(
                        btnMargin: EdgeInsets.only(left: 10),
                        btnChild: Text('登录/注册', style: TextStyle(fontSize: 24, color: Colors.white)),
                        onPressedAction: _onClickLoginOrRegisterButton
                    )

                ],
            ),
        ));
    }

    _onClickLoginOrRegisterButton() {
        if(widget.action != null) {
            widget.action();
        }
    }
}
